<?php
class Activitytype extends AppModel {
	var $name = 'Activitytype';
	var $displayField = 'name';
    var $order = array('Activitytype.name' => 'ASC');
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Activitytemplate' => array(
			'className' => 'Activitytemplate',
			'foreignKey' => 'activitytemplate_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	var $hasMany = array(
		'Potentialactivity' => array(
			'className' => 'Potentialactivity',
			'foreignKey' => 'activitytype_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
        'Useractivity' => array(
			'className' => 'Useractivity',
			'foreignKey' => 'activitytype_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

    var $validate = array(
        'name' => array(
            'notEmpty' => array(
                'rule' => 'notEmpty',
                'required' => true,
                'allowEmpty' => false,
                'message' => 'Please enter a name for activity template'
            ),
            'minLength' => array(
                'rule' => array('minLength', 2),
                'message' => 'Name should be atleast 2 characters long'
            )
        )
    );

}
?>